<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <title>${channel.seoTitle!channel.channelName}-${site.siteName!''}</title>
    <meta name="keywords" content="${channel.seoKeywords!''}"/>
    <meta name="description" content="${channel.seoDesc!''}"/>
    <script src="../common.js"></script>
    <script src='/common/plateform/base/jqPaginator/jqPaginator.js'></script>
  </head>
  <body>
 <header>
 </header>
  <script>$("header").load("../top.html");</script>

<section class="section-container">
  		
  		<form id="searchFrom_CmsManuscript" class="hidden" action="javascript:void(0);" method="post">
			<input type="" name="pageName" value="manuscript-list" />
			<input type="" name="formName" value="searchForm" />
			<input type="" name="tManuscript.w_websiteId" value="${site.siteId!''}" />
			<input type="" name="tManuscript.w_status" value="2" />
			<input type="" name="tManuscript.w_channelCode" value="${channel.codeName!''}" />
			<input type="" name="orderBy" value="tManuscript.published_time desc nulls last" />
			<input type="" name="rows" value="${channel.listPageSize!'10'}" />
			<input type="" name="page" value="10" />
		</form>		
		
		<div class="container panel">
		  	<div class="panel-heading"><h5 class="loc"> <b class="fx2">|</b> <a href="/">首页</a> ><a href="/wcm/${site.siteCode!''}/html/${channel.codeName!''}/index.html">${channel.channelName!''}</a> </h5></div>	  	
	  		<div class="panel-body  body-cont-box" id="dataList-body">
	  		
	  			<!-- 循环体start -->
			  
			   <!-- 循环体end -->
			</div>
			  
	         <!--分页start--> 
			<div class="panel-footer webpage text-center" style="background-color:#fff;">
		           <ul class="pagination " id="pagination"></ul>
	        </div>
	        <!--分页end-->
	        
		</div>
	</section>
    <!-- /.container -->

<!--底部开始--->
 <footer class="footer">
 </footer>
 <script>$("footer").load("../bottom.html");</script>
 <!--底部结束--->
  	
</body>

<!-- 列表模板 -->
<script type="text/template" id="dataList-template">
	<? for ( var i = startNum; i <endNum; i++) {?>
 		<div class="form-group lh35">
			<div class=" col-lg-8 col-md-8 hidden-xs hidden-sm visible-md visible-lg text-left">
				<a href="/wcm/${site.siteCode!''}/html/<?=rows[i].url?>" target="_blank"  title="<?=rows[i].title?>"> 
					<?=strUtil.subStr(rows[i].title,18)?>
				</a>
			</div>
			<div class=" col-xs-12 col-sm-12 visible-xs visible-sm hidden-md hidden-lg text-left">
   				<a href="/wcm/${site.siteCode!''}/html/<?=rows[i].url?>" target="_blank" title="<?=rows[i].title?>"> 
   				 <?=strUtil.subStr2(rows[i].title,22)?>
   				</a>
   			</div>
   			<div class=" col-xs-12 col-sm-12 col-md-4 col-md-4 text-right fx8"><?=strUtil.subStr2(rows[i].publishedTime,10)?></div>
   		</div>
	<?}?>
</script> 

<script>

var dataListId = "dataList";
var pageSize = ${channel.listPageSize!'10'};
var pageNo=1;
var totalCount=1;

$(function(){
	var url = "../../data/${channel.codeName!''}.json";//推送的静态数据文件
	$.getJSON(url,function(myData){
		console.log(myData);
		totalCount = myData.total;
		//定义分页控件
		$("#pagination").jqPaginator({
		    totalCounts:totalCount,
		    pageSize:pageSize,
		    first: 	'<li><a href="javascript:void(0);">首页<\/a><\/li>',
            prev: 	'<li><a href="javascript:void(0);"><i class="arrow arrow2"><\/i>上一页<\/a><\/li>',
            next: 	'<li><a href="javascript:void(0);">下一页<i class="arrow arrow3"><\/i><\/a><\/li>',
            last: 	'<li><a href="javascript:void(0);">末页<\/a><\/li>',
            page: 	'<li><a href="javascript:void(0);">{{page}}<\/a><\/li>',
		    onPageChange: function (num, type) {
		    	pageNo = num;
		    	showCmsManuscriptListData(pageNo,totalCount,myData);
		    }
		});
	})
});

//数据加载显示
function showCmsManuscriptListData(pageNo,totalCount,myData){
	if((pageNo-1)<=myData.rows.length%pageSize){
		//来自推送静态数据
		myData.startNum = (pageNo-1)*pageSize;
		if(pageNo*pageSize>totalCount){
			myData.endNum=totalCount;
		}else{
			myData.endNum = pageNo*pageSize;
		}
		$("#"+dataListId+"-body").html(baidu.template(dataListId+"-template",eval(myData)));
	}else{
		//超过栏目推送条数，请求服务端数据；
		var index_load = layer.msg("数据加载中。。。");
		$("#searchFrom_CmsManuscript").find("input[name='page']").val(pageNo);
		$.getJSON(common_list_url,$("#searchFrom_CmsManuscript").serialize(),function(resultData){
			console.log(resultData);
			resultData.startNum = 0;
			resultData.endNum = resultData.rows.length;
			
			layer.close(index_load);
			$("#"+dataListId+"-body").html(baidu.template(dataListId+"-template",eval(resultData)));
		});
	}
	
}


</script>
</html>